﻿@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        $.ajax({
            url: "/SystemManage/Resource/GetFormJson",
            data: { keyValue: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                $("#form1").formSerialize(data);
                $("#form1").find('.form-control,select,input').attr('readonly', 'readonly');
                $("#form1").find('.parentLayer').attr('disabled', true);
                $("#form1").find('div.ckbox label').attr('for', '');
            }
        });
    });
    function initControl() {
        $("#F_Target").select2({
            minimumResultsForSearch: -1
        });
        $("#resourceowner").bindSelect({
            url: "/SystemManage/Resource/GetTreeSelectJson",
        });
    }
</script>
<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs">
            <li role="presentation" class="active"><a href="#">基本信息</a></li>
            @*<li role="presentation"><a href="#">扩展信息</a></li>*@
        </ul>
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                <tr>
                    <th class="formTitle">上级<span style="color:red">*</span></th>
                    <td class="formValue">
                        <select id="resourceowner" name="resourceowner" class="form-control required parentLayer">
                            <option value="0">父节点</option>
                        </select>
                    </td>
                    <th class="formTitle">名称<span style="color:red">*</span></th>
                    <td class="formValue">
                        <input id="resourcename" name="resourcename" type="text" class="form-control required" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">路径</th>
                    <td class="formValue">
                        <input id="resourceurl" name="resourceurl" type="text" class="form-control" />
                    </td>
                    <th class="formTitle">描述</th>
                    <td class="formValue">
                        <input id="description" name="description" type="text" class="form-control" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">类型<span style="color:red">*</span></th>
                    <td class="formValue">
                        <select id="resourcetype" name="resourcetype" class="form-control required parentLayer">
                            <option value="">==请选择==</option>
                            <option value="1" title="1">1</option>
                            <option value="2" title="2">2</option>
                            <option value="3" title="3">3</option>
                            <option value="4" title="4">4</option>
                        </select>
                    </td>
                    <th class="formTitle">级别<span style="color:red">*</span></th>
                    <td class="formValue">
                        <select id="resourceleval" name="resourceleval" class="form-control required parentLayer">
                            <option value="">==请选择==</option>
                            <option value="1" title="1">1</option>
                            <option value="2" title="2">2</option>
                            <option value="3" title="3">3</option>
                            <option value="4" title="4">4</option>
                        </select>
                    </td>
                </tr>
                @*<tr>
                    <th class="formTitle">样式</th>
                    <td class="formValue">
                        <div class="input-group">
                            <input id="resourceclass" name="resourceclass" type="text" class="form-control">
                            <span class="input-group-btn">
                                <a class="btn  btn-primary"><i class="fa fa-ellipsis-h"></i></a>
                            </span>
                        </div>
                    </td>
                    <th class="formTitle">预警数量</th>
                    <td class="formValue">
                        <input id="resourcenumber" name="resourcenumber" type="text" class="form-control required" placeholder="请输入预警数量" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">左侧图标</th>
                    <td class="formValue">
                        <div class="input-group">
                            <input id="resourceleftico" name="resourceleftico" type="text" class="form-control">
                            <span class="input-group-btn">
                                <a class="btn  btn-primary"><i class="fa fa-ellipsis-h"></i></a>
                            </span>
                        </div>
                    </td>
                    <th class="formTitle">右侧图标</th>
                    <td class="formValue">
                        <div class="input-group">
                            <input id="resourcerightico" name="resourcerightico" type="text" class="form-control">
                            <span class="input-group-btn">
                                <a class="btn  btn-primary"><i class="fa fa-ellipsis-h"></i></a>
                            </span>
                        </div>
                    </td>
                </tr>*@
                <tr>
                    <th class="formTitle">排序<span style="color:red">*</span></th>
                    <td class="formValue">
                        <input id="order" name="order" type="text" class="form-control required" placeholder="请输入排序" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle" valign="top" style="padding-top: 5px;">脚本
                    </th>
                    <td class="formValue" colspan="3">
                        <textarea id="resourcescript" name="resourcescript" class="form-control" style="height: 100px;"></textarea>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
